package com.example.biz.impl;

import com.example.biz.UserBiz;
import com.example.dao.UserDao;
import com.example.entity.User;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserBizImpl implements UserBiz {

    @Resource
    private UserDao userDao;

    public int insertUser(User user) {
        return userDao.insertUser(user);
    }

    public PageInfo<User> findListUser(int page, int size) {
        PageHelper.startPage(page, size);
        List<User> users = userDao.findListUser();
        return new PageInfo<>(users);
    }

}
